package biz

import "context"

type AuthUseCase struct {
	userRepo UserRepo
}

func NewAuthUseCase(repo UserRepo) *AuthUseCase {
	return &AuthUseCase{
		userRepo: repo,
	}
}

func (uc *AuthUseCase) Login(ctx context.Context, user *User) (*User, error) {
	return uc.userRepo.VerifyPassword(ctx, user)
}

func (uc *AuthUseCase) Register(ctx context.Context, user *User) (*User, error) {
	return uc.userRepo.CreateUser(ctx, user)
}
